{% load i18n %}

<div id="addSubjectLesson">
    <form class="addSubjectLesson_{{ timetable.id }}" action="{% url "donutscheduler.views.addSubjectLesson" %}" method="post">
    {% csrf_token %}

    <div class="accordion" id="accordion2">
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                    Add new Subject
                </a>
            </div>
            <div id="collapseOne" class="accordion-body collapse in">
                <div class="accordion-inner">
                    {% for field in subject_form %}

                        {% if field.errors %}
                            {% if field.name != 'timetable' %}

                            <div class="alert">
                                <button type="button" class="close" data-dismiss="alert">&times;</button>
                                {{ field.errors }}
                            </div>
                            {% endif %}
                        {% endif %}
                        {% if field.name != 'timetable' %}

                            <div style="float: left; margin: 5px 0 0 0;">{{ field.label_tag }}</div><div>{{ field }}</div>
                        {% endif %}
                        {% if field.name == 'timetable' %}
                            <input id="id_timetable_{{ timetable.id }}" name="timetable" type="hidden" />
                        {% endif %}
                    {% endfor %}
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                    Choose Subject
                </a>
            </div>
            <div id="collapseTwo" class="accordion-body collapse">
                <div class="accordion-inner">
                    <select id="professorChoice">
                        <option value="0" selected="selected">{% trans "professor..." %}</option>
                    </select>
                    <select id="subjectChoice">
                    </select>
                </div>
            </div>
        </div>
    </div>

    {% for field in lesson_form %}
        {% if field.errors %}
            {% if field.name != 'les_day' %}
            <div class="alert">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                {{ field.errors }}
            </div>
            {% endif %}
        {% endif %}
        {% if field.name != 'les_day' %}
            <div style="float: left; margin: 5px 0 0 0;">{{ field.label_tag }}</div><div>{{ field }}</div>

        {% endif %}
        {% if field.name == 'les_day' %}
            <div><input class="lesson_day" id="id_les_day_{{ timetable.id }}" name="les_day" type="hidden" /></div>
        {% endif %}
    {% endfor %}
    <!--<input type="submit" id="button_addSubjectLesson" class="btn btn-primary" value="{% trans "ADD" %}">-->
    </form>
</div>
